import request from '@/utils/request'

export default{
    //1.新增章节
    saveChapter(chapter){
        return request({
            url:'/admin/edu/chapter/saveChapter',
            method: 'post',
            data: chapter
        })
    },
    //2.查询章节课时的嵌套集合
    chapterNestedList(courseId){
        return request({
            url:`/admin/edu/chapter/getChapterNested/${courseId}`,
            method: 'get'
        })
    },
    //3.删除指定章节的方法
    removeChapter(chapterId){
        return request({
            url:`/admin/edu/chapter/removeChapter/${chapterId}`,
            method: 'delete'
        })
    },
    //4.查询指定chapterId的章节
    getChapter(chapterId){
        return request({
            url:`/admin/edu/chapter/getChapter/${chapterId}`,
            method:'get'
        })
    },
    //5.更新章节
    updateChapter(chapter){
        return request({
            url:`/admin/edu/chapter/updateChapter`,
            method:'put',
            data: chapter
        })
    }
}